<include file="./Template/Admin/header.html" title="广告列表" />
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>广告列表</h5>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>排序</th>
                                    <th>广告名称</th>
                                    <th>广告类型</th>
                                    <th>所属版位</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="pageView">
                            <volist name="list" id="value">
                                <tr>
                                    <td>{$value.id}</td>
                                    <td>{$value.sort}</td>
                                    <td>{$value.title}</td>
                                    <td>{$value.type}</td>
                                    <td>{$value.name}</td>
                                    <td>
                                        <if condition="$value.status eq 1">
                                            <a href="javascript:statusChange({$value.id});" class="btn btn-sm btn-outline btn-primary" id="status{$value.id}">正常</a>
                                        <else />
                                            <a href="javascript:statusChange({$value.id});" class="btn btn-sm btn-outline btn-danger" id="status{$value.id}">禁用</a>
                                        </if>
                                    </td>
                                    <td>
                                        <div class="col-md-12">
                                            <a class="btn btn-sm btn-outline btn-warning" href="{:U('Poster/edit?id='.$value['id'])}"><i class="fa fa-edit"></i> 修改</a>
                                            <a class="btn btn-sm btn-outline btn-danger" href="javascript:del({$value.id})"><i class="fa fa-trash-o"></i> 删除</a></div>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__ADMIN__js/jquery.min.js"></script>
    <script src="__ADMIN__js/bootstrap.min.js"></script>
    <script src="__ADMIN__js/plugins/layer.3/layer.js"></script>
    <script src="__ADMIN__js/plugins/laypage/laypage.js"></script>
    <script src="__ADMIN__js/common.js"></script>
    <script src="__ADMIN__js/plugins/switchery/switchery.js"></script>
    <script>
        $(function(){
            del = function(id){
                common.ajaxDel("{:U('Admin/Poster/del')}",id,"{:U('Admin/Poster/index')}");
            };
            statusChange = function(id){
                common.ajaxStatusChange("{:U('Admin/Poster/statusChange')}", id, $('#status' + id));
            };
        });
    </script>
</body>
</html>
